package example01;

import java.awt.*;
import javax.swing.*;
import net.sf.jeppers.grid.*;

/**
 * @author grom
 */
public class PropGridDemo extends JFrame {	
	public PropGridDemo() {
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
		JGrid grid = new JGrid();
		for (int col = 0; col < grid.getColumnCount(); col++) {
			grid.setColumnWidth(col, 50);
			for (int row = 0; row < grid.getRowCount(); row++) {
				grid.setValueAt("" + row + col, row, col);
			}
		}
		
		grid.setGridColor(Color.blue);
		grid.setFocusBackgroundColor(Color.green);		
		
		JScrollGrid scrollGrid = new JScrollGrid(grid);
		scrollGrid.getRowHeader().setColumnWidth(0, 50);	
		getContentPane().add(scrollGrid, BorderLayout.CENTER);
		
		pack();
	}
	
	public static void main(String[] args) {
	  PropGridDemo sg = new PropGridDemo();

	  Dimension big=Toolkit.getDefaultToolkit().getScreenSize();
	  Dimension small=sg.getSize();
	  sg.setLocation((big.width-small.width)/2,
					 (big.height-small.height)/2);

	  sg.setVisible(true);
	}	
}
